﻿namespace QLPhongKham.Access
{
    using System;
    using System.Data;

    public class HangSo
    {
        public enum enGioiTinh
        {
            Nam,
            Nu
        }

        public static class GioiTinh
        {
            public static DataTable f_DanhSach()
            {
                DataTable table = new DataTable();
                table.Columns.Add("id", typeof(int));
                table.Columns.Add("ten");
                table.Rows.Add(new object[] { HangSo.enGioiTinh.Nam.GetHashCode(), "Nam" });
                table.Rows.Add(new object[] { HangSo.enGioiTinh.Nu.GetHashCode(), "Nữ" });
                return table;
            }
        }

        public static class LoaiBenhNhan
        {
            public static DataTable f_DanhSach()
            {
                DataTable table = new DataTable();
                table.Columns.Add("id");
                table.Columns.Add("ten");
                DataRow row = table.NewRow();
                row[0] = 1;
                row[1] = "Tiếp đ\x00f3n";
                table.Rows.Add(row);
                row = table.NewRow();
                row[0] = 2;
                row[1] = "Ph\x00f2ng kh\x00e1m";
                table.Rows.Add(row);
                row = table.NewRow();
                row[0] = 3;
                row[1] = "Ngoại tr\x00fa";
                table.Rows.Add(row);
                row = table.NewRow();
                row[0] = 4;
                row[1] = "Nội tr\x00fa";
                table.Rows.Add(row);
                return table;
            }

            public static int pNgoaiTru
            {
                get
                {
                    return 3;
                }
            }

            public static int pNoiTru
            {
                get
                {
                    return 4;
                }
            }

            public static int pPhongKham
            {
                get
                {
                    return 2;
                }
            }

            public static int pTiepDon
            {
                get
                {
                    return 1;
                }
            }
        }

        public static class LoaiNhapKho
        {
            public static DataTable f_DanhSach()
            {
                DataTable table = new DataTable();
                table.Columns.Add("id", typeof(int));
                table.Columns.Add("ten");
                table.Rows.Add(new object[] { enLoaiNhapKho.NhapMoi.GetHashCode(), "Nhập mới" });
                table.Rows.Add(new object[] { enLoaiNhapKho.TaiNhap.GetHashCode(), "T\x00e1i nhập" });
                return table;
            }

            public static enLoaiNhapKho f_get_LoaiXuatKho(int id)
            {
                if (id == enLoaiNhapKho.NhapMoi.GetHashCode())
                {
                    return enLoaiNhapKho.NhapMoi;
                }
                return enLoaiNhapKho.TaiNhap;
            }

            public enum enLoaiNhapKho
            {
                NhapMoi = 1,
                TaiNhap = 2
            }
        }

        public static class LoaiNoiDungVienPhi
        {
            public static DataTable f_DanhSach()
            {
                DataTable table = new DataTable();
                table.Columns.Add("id", typeof(int));
                table.Columns.Add("ten");
                table.Rows.Add(new object[] { enLoaiNoiDungVP.DichVu.GetHashCode(), "Dịch vụ" });
                table.Rows.Add(new object[] { enLoaiNoiDungVP.Thuoc.GetHashCode(), "Thuốc" });
                return table;
            }

            public static enLoaiNoiDungVP f_get_LoaiXuatKho(int id)
            {
                switch (id)
                {
                    case 1:
                        return enLoaiNoiDungVP.DichVu;

                    case 2:
                        return enLoaiNoiDungVP.Thuoc;
                }
                return enLoaiNoiDungVP.DichVu;
            }

            public enum enLoaiNoiDungVP
            {
                DichVu = 1,
                Thuoc = 2
            }
        }

        public static class LoaiTuoi
        {
            public static DataTable f_DanhSach()
            {
                DataTable table = new DataTable();
                table.Columns.Add("id");
                table.Columns.Add("ten");
                DataRow row = table.NewRow();
                row[0] = 1;
                row[1] = "Tuổi";
                table.Rows.Add(row);
                row = table.NewRow();
                row[0] = 2;
                row[1] = "Th\x00e1ng";
                table.Rows.Add(row);
                row = table.NewRow();
                row[0] = 3;
                row[1] = "Ng\x00e0y";
                table.Rows.Add(row);
                return table;
            }

            public static int pNgay
            {
                get
                {
                    return 3;
                }
            }

            public static int pThang
            {
                get
                {
                    return 2;
                }
            }

            public static int pTuoi
            {
                get
                {
                    return 1;
                }
            }
        }

        public static class LoaiXuatKho
        {
            public static DataTable f_DanhSach()
            {
                DataTable table = new DataTable();
                table.Columns.Add("id", typeof(int));
                table.Columns.Add("ten");
                table.Rows.Add(new object[] { enLoaiXuatKho.XuatBanLe.GetHashCode(), "Xuất b\x00e1n lẻ" });
                table.Rows.Add(new object[] { enLoaiXuatKho.XuatBanKhongKeDon.GetHashCode(), "Xuất b\x00e1n kh\x00f4ng k\x00ea đơn" });
                return table;
            }

            public static enLoaiXuatKho f_get_LoaiXuatKho(int id)
            {
                if (id == enLoaiXuatKho.XuatBanLe.GetHashCode())
                {
                    return enLoaiXuatKho.XuatBanLe;
                }
                return enLoaiXuatKho.XuatBanKhongKeDon;
            }

            public enum enLoaiXuatKho
            {
                XuatBanKhongKeDon = 2,
                XuatBanLe = 1
            }
        }

        public static class NhomKhachHang
        {
            public static DataTable f_DanhSach()
            {
                DataTable table = new DataTable();
                table.Columns.Add("id", typeof(int));
                table.Columns.Add("ten");
                table.Rows.Add(new object[] { enNhomKhachHang.Thuong.GetHashCode(), "Thường" });
                table.Rows.Add(new object[] { enNhomKhachHang.DichVu.GetHashCode(), "Dịch vụ" });
                return table;
            }

            public static enNhomKhachHang f_get_NhomKhachHang(int id)
            {
                if (enNhomKhachHang.DichVu.GetHashCode() == id)
                {
                    return enNhomKhachHang.DichVu;
                }
                return enNhomKhachHang.Thuong;
            }

            public enum enNhomKhachHang
            {
                Thuong,
                DichVu
            }
        }
    }
}

